<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-if</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="切换显示" @click="toggleIsShow">
        <!-- 这个是操作DOM树 -->
        <p v-if="isShow">陈独秀</p>
        <!-- 频繁切换的用v-show -->
        <p v-show="isShow">陈独秀</p>

        <h2 v-if="temperature >= 35">热死了</h2>
    </div>

    <script>
        var app = new Vue({
            el:"#app",
            data:{
                isShow:false,
                temperature:40
            },
            methods:{
                toggleIsShow:function(){
                    this.isShow = !this.isShow;
                }

            }

        })
    </script>
    
</body>
</html>